﻿<%@ Page Language="C#" MasterPageFile="~/Management/ManagementMasterPage.master"
    AutoEventWireup="true" Inherits="Management_Product_ProductList" Title="逸品--管理端"
    EnableEventValidation="true" CodeBehind="ProductList.aspx.cs" %>

<%@ Register Src="../../Controls/CategoryCascadingDropDown.ascx" TagName="CategoryCascadingDropDown"
    TagPrefix="uc1" %>
<%@ Register Src="../../Controls/BrandDropDownList.ascx" TagName="BrandDropDownList"
    TagPrefix="uc2" %>
<%@ Register Src="../../Controls/SeriesDropDownList.ascx" TagName="SeriesDropDownList"
    TagPrefix="uc3" %>
<asp:Content ID="Content2" ContentPlaceHolderID="cphContent" runat="Server">
    <a href="ProductEditor.aspx">新增产品</a>
    <asp:RadioButtonList ID="rblType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="rblType_SelectedIndexChanged"
        RepeatDirection="Horizontal">
        <asp:ListItem Text="全部" Value="" Selected="True" />
        <asp:ListItem Text="产品分类" Value="Category" />
    </asp:RadioButtonList>
    <asp:Panel ID="pnlBrand" runat="server">
        <uc2:BrandDropDownList ID="ddlBrand" runat="server" />
        <uc3:SeriesDropDownList ID="ddlSeries" runat="server" AddListItem="ItemAll" />
    </asp:Panel>
    <asp:Panel ID="pnlCategory" runat="server">
        <asp:DropDownList ID="ddlL1Category" runat="server" OnSelectedIndexChanged="ddlL1Category_SelectedIndexChanged"
            AutoPostBack="True">
        </asp:DropDownList>
        <asp:DropDownList ID="ddlL2Category" runat="server" OnSelectedIndexChanged="ddlL2Category_SelectedIndexChanged"
            AutoPostBack="True">
        </asp:DropDownList>
        <asp:DropDownList ID="ddlL3Category" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlL3Category_SelectedIndexChanged">
        </asp:DropDownList>
        <%--<uc1:CategoryCascadingDropDown ID="ddlCategory" TopCategoryName=Category_L  
            runat="server" ShowLv2Category="True" ShowLv3Category="True" />--%>
    </asp:Panel>
    <div>
        <asp:TextBox ID="txtProductCode" runat="server"></asp:TextBox>(产品编号)<asp:Button ID="btnShow"
            runat="server" Text="搜索产品" OnClick="btnShow_Click" /></div>
    <div>
        <asp:DataPager ID="dpProduct1" runat="server" PagedControlID="lvProdust" PageSize="20">
            <Fields>
                <asp:NumericPagerField />
            </Fields>
        </asp:DataPager>
        <asp:ListView ID="lvProdust" runat="server" OnItemCommand="lvProdust_ItemCommand"
            OnPagePropertiesChanged="lvProdust_PagePropertiesChanged">
            <LayoutTemplate>
                <table cellpadding="2" border="1">
                    <tr>
                        <th>
                        </th>
                        <th>
                            产品编号
                        </th>
                        <th>
                            品名
                        </th>
                        <th>
                            Other
                        </th>
                    </tr>
                    <tr id="itemPlaceholder" runat="server" />
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <asp:Image ID="Image1" ImageUrl='<%# Eval("PictureUrl") %>' runat="server" Height="96"
                            Width="96" />
                    </td>
                    <td>
                        <%# Eval("ProductCode") %>
                    </td>
                    <td>
                        <%# Eval("Name") %>
                    </td>
                    <%--<td>
					<%# Eval("ProductCategory.Name") %>
				</td>
				<td>
					<%# Eval("Comments.Count") %>
				</td>
				<td>
					<%# Eval("Views") %>
				</td>	--%>
                    <td>
                        <a href='ProductEditor.aspx?PID=<%# Eval("ProductId") %>'>Edit</a>
                        <asp:LinkButton ID="btnDelete" runat="server" CommandName="OnDelete" CommandArgument='<%# Eval("ProductId") %>' OnClientClick="return confirm('删除该产品，该产品的评论也会一起删除。确认要删除吗？');">Delete</asp:LinkButton>
                        <asp:LinkButton ID="btnRecommend" runat="server" CommandName="OnRecommend" CommandArgument='<%# Eval("ProductId") %>'>商城新品</asp:LinkButton>
                        <asp:LinkButton ID="btnNewest" runat="server" CommandName="OnFocus" CommandArgument='<%# Eval("ProductId") %>'>最近销售</asp:LinkButton>
                        <asp:LinkButton ID="btnPlateProduct" CommandName="OnPlate" CommandArgument='<%# Eval("ProductId") %>'
                            runat="server">商城推荐</asp:LinkButton>
                        <a href='ProductComment.aspx?PID=<%# Eval("ProductId") %>'>查看评论</a>
                        <asp:LinkButton ID="btnPoint" runat="server" CommandName="OnPoint" CommandArgument='<%# Eval("ProductId") %>' >积分商品</asp:LinkButton>
<%--                        <cc1:ConfirmButtonExtender ID="btnDelete_ConfirmButtonExtender" runat="server" ConfirmText="删除该产品，该产品的评论也会一起删除。确认要删除吗？"
                            Enabled="True" TargetControlID="btnDelete" />--%>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:ListView>
        <asp:DataPager ID="dpProduct2" runat="server" PagedControlID="lvProdust" PageSize="20">
            <Fields>
                <asp:NumericPagerField />
            </Fields>
        </asp:DataPager>
    </div>
    <asp:HiddenField ID="hfProductId" runat="server" />
</asp:Content>
